package liuch.JMS;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.jms.JMSException;

/**
 * @author 17101651
 * @ClassName SpringJMSActiveMQReceiverTest
 * @Description jmsTempalte接收信息
 * @data 2018年08月18日
 */
public class SpringJMSActiveMQReceiverTest {
    public static void main(String[] args) throws JMSException {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("/conf/spring/jms/beanFactoryConsumersTest.xml");

        // 因为定义了DemoMessageListener，
//        JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsTemplate");
//        Queue queue = (Queue) applicationContext.getBean("queue");
//
//        TextMessage message = (TextMessage) jmsTemplate.receive(queue);
//        System.out.println(message.getText());

    }
}
